﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="ShowCustomer.aspx.cs" Inherits="Project_Udrinkwater.PagesAdmin.ShowCustomer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="RPN_ShowCustomer" runat="server" Width="100%" 
        HeaderText="ข้อมูลลูกค้า">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
    <div>
        <table align="right">
            <tr>
                <td>
                    <dx:ASPxButton ID="Export_Xsl" runat="server" Text="พิมพ์รายงาน Excel" 
                        OnClick="Export_Xsl_Click">
                    </dx:ASPxButton>
                </td>
                <td>
                    <dx:ASPxButton ID="Export_PDF" runat="server" Text="พิมพ์รายงาน PDF" 
                        OnClick="Export_PDF_Click">
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
    </div>
     <dx:ASPxGridView ID="GV_ShowCustomer" runat="server" 
        AutoGenerateColumns="False" DataSourceID="SqlDataSource_ShowCustomer" 
        KeyFieldName="Customer_ID" Width="100%" 
        OnHtmlEditFormCreated="GV_ShowCustomer_HtmlEditFormCreated" 
        OnRowUpdating="GV_ShowCustomer_RowUpdating">
        <Columns>
            <dx:GridViewCommandColumn Caption="รายการ" ShowInCustomizationForm="True" 
                VisibleIndex="13">
                <EditButton Visible="True">
                </EditButton>
                <DeleteButton Visible="True">
                </DeleteButton>
            </dx:GridViewCommandColumn>
            <dx:GridViewDataTextColumn FieldName="Customer_ID" 
                ReadOnly="True" VisibleIndex="0" Caption="รหัสพนักงาน">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="E_mail" 
                VisibleIndex="1" Caption="อีเมลล์">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Password" 
                VisibleIndex="2" Visible="False">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Prefix" 
                VisibleIndex="3" Caption="คำนำหน้า">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Firstname" 
                VisibleIndex="4" Caption="ชื่อ">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Lastname" 
                VisibleIndex="5" Caption="นามสกุล">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Adress" 
                VisibleIndex="6" Caption="ที่อยู่">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Caption="ตำบล" FieldName="DISTRICT_ID" 
                ShowInCustomizationForm="True" VisibleIndex="7">
                <PropertiesComboBox DataSourceID="District" TextField="DISTRICT_NAME" 
                    ValueField="DISTRICT_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Caption="อำเภอ" FieldName="AMPHUR_ID" 
                ShowInCustomizationForm="True" VisibleIndex="8">
                <PropertiesComboBox DataSourceID="Aumphur" TextField="AMPHUR_NAME" 
                    ValueField="AMPHUR_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Caption="จังหวัด" FieldName="PROVINCE_ID" 
                ShowInCustomizationForm="True" VisibleIndex="9">
                <PropertiesComboBox DataSourceID="Province" TextField="PROVINCE_NAME" 
                    ValueField="PROVINCE_ID" ValueType="System.Int32">
                </PropertiesComboBox>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn FieldName="Postcode" 
                VisibleIndex="10" Caption="รหัสไปรษณีย์">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Phone" 
                VisibleIndex="11" Caption="เบอร์โทร">
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn FieldName="Fax" VisibleIndex="12" 
                Caption="แฟกซ์">
            </dx:GridViewDataTextColumn>
        </Columns>
         <Templates>
             <EditForm>
                 <table style="width: 100%">
                     <tr>
                         <td align="right" style="width: 389px">
                             คำนำหน้าชื่อ :</td>
                         <td style="width: 229px">
                             <dx:ASPxTextBox ID="tb_prefix" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                         <td align="right" style="width: 93px">
                             &nbsp;</td>
                         <td>
                             &nbsp;</td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             ชื่อ :</td>
                         <td style="width: 229px">
                             <dx:ASPxTextBox ID="tb_name" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                         <td align="right" style="width: 93px">
                             นามสกุล :</td>
                         <td>
                             <dx:ASPxTextBox ID="tb_lname" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             ที่อยู่ :</td>
                         <td style="width: 229px">
                             <dx:ASPxTextBox ID="tb_address" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                         <td align="right" style="width: 93px">
                             &nbsp;</td>
                         <td>
                             &nbsp;</td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             จังหวัด :</td>
                         <td style="width: 229px">
                             <dx:ASPxComboBox ID="CB_Province" runat="server" DataSourceID="Province" 
                                 TextField="PROVINCE_NAME" ValueField="PROVINCE_ID" 
                                 onselectedindexchanged="CB_Province_SelectedIndexChanged">
                             </dx:ASPxComboBox>
                         </td>
                         <td align="right" style="width: 93px">
                             &nbsp;</td>
                         <td>
                             &nbsp;</td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             อำเภอ :</td>
                         <td style="width: 229px">
                             <dx:ASPxComboBox ID="CB_Aumphur" runat="server" DataSourceID="Aumphur" 
                                 TextField="AMPHUR_NAME" ValueField="AMPHUR_ID" 
                                 onselectedindexchanged="CB_Aumphur_SelectedIndexChanged">
                             </dx:ASPxComboBox>
                         </td>
                         <td align="right" style="width: 93px">
                             &nbsp;</td>
                         <td>
                             &nbsp;</td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             ตำบล :</td>
                         <td style="width: 229px">
                             <dx:ASPxComboBox ID="CB_District" runat="server" DataSourceID="District" 
                                 TextField="DISTRICT_NAME" ValueField="DISTRICT_ID" 
                                 onselectedindexchanged="CB_District_SelectedIndexChanged">
                             </dx:ASPxComboBox>
                         </td>
                         <td align="right" style="width: 93px">
                             &nbsp;</td>
                         <td>
                             &nbsp;</td>
                     </tr>
                     <tr>
                         <td align="right" style="width: 389px">
                             เบอร์โทร :</td>
                         <td style="width: 229px">
                             <dx:ASPxTextBox ID="tb_tel" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                         <td align="right" style="width: 93px">
                             Email :</td>
                         <td>
                             <dx:ASPxTextBox ID="tb_email" runat="server" Width="170px">
                             </dx:ASPxTextBox>
                         </td>
                     </tr>
                 </table>
                  <div style="text-align: right; padding: 2px 2px 2px 2px">
                 <dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton"
                        runat="server">
                    </dx:ASPxGridViewTemplateReplacement>
                    <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton"
                        runat="server">
                    </dx:ASPxGridViewTemplateReplacement>
                    </div>
             </EditForm>
         </Templates>
    </dx:ASPxGridView>
    <dx:ASPxGridViewExporter ID="GV_ExportCostomer" runat="server" 
        GridViewID="GV_ShowCustomer">
        <Styles>
            <Header Font-Names="Angsana New">
            </Header>
            <Cell Font-Names="Angsana New">
            </Cell>
        </Styles>
        <PageHeader Center="รายงานข้อมูลลูกค้า">
            <Font Bold="True" Size="18px" Names="Angsana New"></Font>
        </PageHeader>
    </dx:ASPxGridViewExporter>
    <asp:SqlDataSource ID="SqlDataSource_ShowCustomer" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        
        SelectCommand="SELECT * FROM [TB_Customer]">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="Province" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Province]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="Aumphur" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_Amphur]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="District" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
        SelectCommand="SELECT * FROM [TB_District]"></asp:SqlDataSource>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
